#include <iostream>
using namespace std;
const int N = 5010; 
int a[N] = {0};
int main()
{
   int n;
   cin >> n; 
   for(int i =2;i<=N;i++)
   {
   	 for(int j = 2;j<=n;j++)
   	 {
   	 	if(j%i == 0)
   	 	{
   	 		a[j] ^= 1;
		}
		}
   }
   for(int i = 1;i<=n;i++)
   {
   	if(a[i])
   	{
   		cout << i <<" ";
	   }
   }
   
}
